package cn.itrigger.publish;

import cn.itrigger.config.VersionConfig;
import org.apache.commons.lang3.StringUtils;

/**
 * 发布snapsho版本<br>
 * snapshot只需要往nexus上发布即可
 */
public class DailyVersionPublish extends VersionPublish<Void> {
    private VersionConfig config;

    public DailyVersionPublish(VersionConfig config) {
        this.config = config;
    }

    @Override
    public Void publish() {
        if (StringUtils.isNotBlank(config.getDeploy()) && Boolean.valueOf(config.getDeploy())) {
            deployToNexus(config);
        } else {
            packageToLocal(config);
        }

        return null;
    }
}
